#pragma once 

#ifndef RANDOMMULTIDECISION_H
#define RANDOMMULTIDECISION_H

#include <cstlib>
#include "MultiDecision.h"

template<typename T>
class RandomMultiDecision : public MultiDecision<T>
{
public:
	RandomMultiDecision(std::list<DecisionTreeNode<T>*> childNodes)
		: MultiDecision<T>(childNodes) { }
	virtual ~RandomMultiDecision() { }
	DecisionTreeNode<T>* getBranch(T* owner);
};

#endif

template<typename T>
DecisionTreeNode<T>* RandomMultiDecision<T>::getBranch(T* owner)
{
	int choice = rand() % childNodes.size();
	return childNodes[choice];
}
